import classnames from 'classnames'

interface IFormItemProps {
  label: string
  labelCls?: string
  children?: React.ReactElement | React.ReactElement[]
}

export function IFormItem(props: IFormItemProps) {
  const {
    label,
    children,
    labelCls,
  } = props;

  return (
    <div className={classnames('flex items-center mb-4')} >
      <div className={classnames('block w-[70px] text-[12px] text-right', labelCls)}>{ label }：</div>
      <div className='flex-grow'>
        { children }
      </div>
    </div>
  )
}